//
//  WATFPingSer.h
//  WiFiFaster
//
//  Created by one on 2024/1/2.
//

#import <Foundation/Foundation.h>

#import <CoreGraphics/CoreGraphics.h>
#import "WATFPingCom.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, WATFPingStatus) {
    WATFPingStatusDidStart,
    WATFPingStatusDidFailToSendPacket,
    WATFPingStatusDidReceivePacket,
    WATFPingStatusDidReceiveUnexpectedPacket,
    WATFPingStatusDidTimeout,
    WATFPingStatusError,
    WATFPingStatusFinished,
};

@interface WATFPingModel : NSObject

@property(nonatomic) NSString *originalAddress;
@property(nonatomic, copy) NSString *IPAddress;

@property(nonatomic) NSUInteger dateBytesLength;
@property(nonatomic) double     timeMilliseconds;
@property(nonatomic) NSInteger  timeToLive;
@property(nonatomic) NSInteger  ICMPSequence;

@property(nonatomic) WATFPingStatus status;

+ (NSString *)statisticsWithPingItems:(NSArray *)pingItems;

@end
@interface WATFPingSer : NSObject
@property(nonatomic) double timeoutMilliseconds;

+ (WATFPingSer *)startPingAddress:(NSString *)address
                      callbackHandler:(void(^)(WATFPingModel *pingItem, NSArray *pingItems))handler;

@property(nonatomic) NSInteger  maximumPingTimes;
- (void)watf_stop;
@end

NS_ASSUME_NONNULL_END

